#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author: 邵奈一
@Email: shaonaiyi@163.com
@Date: 2024/11/15
@微信：shaonaiyi888
@微信公众号: 邵奈一 
"""
import torch
import torch.nn as nn
from four_four_build_network import MYNET

# 查看网络结构
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
model = MYNET().to(device)

# 代码4-5
# 设置优化器
# 优化器
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)

# 代码4-6
# 设置损失函数
loss_func = nn.CrossEntropyLoss()